<!DOCTYPE html>
<html>
<head lang="en">
    <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no"/>
    <meta name = "format-detection" content="telephone = no" />
    <link rel="shortcut icon" href="img/smlogo.png" type="image/x-icon">
    <meta charset="UTF-8">
    <title>Pulu-资讯</title>
    <script>
        if(/news/.test(location.href)||top.location.href!==location.href){
            var ua = navigator.userAgent.toLowerCase();
            if(!/micromessenger/.test(ua)&&!/https/.test(location.href)){
                location.href="https://www.pulu.com/weixin/subscribe.html";
            }else{
                location.href="http://www.pulu.com/weixin/subscribe.html";
            }
        };
    </script>
    <link rel="stylesheet" href="css/index2.css"/>
    <link rel="stylesheet" href="css/zhuce.css"/>
    <link rel="stylesheet" href="css/puluindex.css"/>
    <link rel="stylesheet" href="css/popup.css"/>
    <link rel="stylesheet" href="css/mycountry.css"/>
    <link rel="stylesheet" href="css/commentrestyle.css"/>
    <style>
        html{
            height:100%;
            background: #ececec;
        }
        body{
            max-width:1000px;
        }
        .tishiword{
            height:auto;
            min-height:37px;
            width:100%;
            max-width: 1000px;
            border:none;
            background: #ECECEC;
            margin-left:0;
            /*margin-top:80px;*/
            position: fixed;
            top: 22px;
            z-index: 100;
        }
        .Header .fixed_header .header_main .header_action_buttons{right:100px;}
        .header_action_buttons.mweb_lookup_bar_has_input>div.mweb_lookup_bar_input_wrapper{
            left: 4px;
            right: 10px;
            top: 8px;
        }
        #choiceThree{
            max-width:1000px;
            margin:0 auto;
        }
        #choiceThree .tc_inner{padding-left:65px;}
        .tc_text.rt{
            border: 1px solid #34A933;
            color:#fff;
            background: #1AAD19;
            border-radius: 3px;
            font-size: 12px;
            padding:2px 5px;
        }
        .tc_text.rt.subscribe{
            cursor: pointer;
            border: 1px solid #999;
            color:#fff;
            background: #999;
        }
        .rt.look{
            border: 1px solid #FF0000;
            color: #fff;
            background: #FF0000;
            border-radius: 3px;
            font-size: 12px;
            padding: 2px 5px;
            margin-right:10px;
        }
        .Cell .tc_image{padding-top:12px;}
        /*9个订阅号提示*/
        #maxNine{
            display:none;
            position:fixed;
            top:44px;
            z-index: 300;
            width:100%;
            max-width: 1000px;
            margin:0 auto;
            height:40px;
            line-height:40px;
            box-sizing: border-box;
            padding-left:20px;
            color:#ff9a14;
            background: rgba(0,0,0,.6);
            font-size: 14px;
            text-align: center;
        }
        #maxNine>.max{display:none;}
        #maxNine>.min{display:none;}
        .hylistbox,.alllistbox{
            display:none;
            margin-top:117px;
        }
        .hylistbox,.zhlistbox{
            display:none;
            margin-top:117px;
        }
        .hylistbox,.xqlistbox{
            display:none;
            margin-top:117px;
        }
        .lastbox{
            display:none;
            margin-top:80px;
        }
        .inputsearchbox{display:none;}
        nav{
            position: fixed;
            max-width: 1000px;
            z-index: 200;
            top: 44px;
            width: 100%;
            box-sizing: border-box;
            background: #f3f3f3;
            background-image: linear-gradient(to bottom,#f3f3f3,#ebebeb);
            box-shadow: 0 1px 1px rgba(0,0,0,.3);
        }
        nav>a {
            font-size:15px;
            border: #cacaca solid 1px;
            color: #5d5d5d;
            border-color: #cacaca #cacaca #f9f9f9 #f9f9f9;
            border-top: 0;
            border-bottom: 0;
            width: 33.3%;
            /*font-size: .8125rem;*/
            text-shadow: 0 1px 0 rgba(255,255,255,.75);
            position: relative;
            line-height: 35px;
            text-align: center;
            display: inline-block;
            box-sizing: border-box;
        }
        nav a.active {
            background: rgba(0,0,0,.05);
            color: #b92b27;
        }
        nav>a:first-child {  border-left: none;  }
        nav>a:nth-child(2) {  width: 33.3%;  }
        nav>a:last-child {  border-right: none;  }
        .alllistbox{margin-top:118px;}
        .tishiword{display:none;}
        .alllistbox .feed_item .feed_answer_preview{margin-bottom:14px;}
        .alllistbox .ActionBar{display:none;}
        .ModalHeader .fixed_header .header_main .page_title.unified{display:none;}
    </style>
    <style>
        .allnewsbox{padding-top:40px;}
        #pleasewait>div.waitbox{text-align:right;}
    </style>
    <style>
        .tishiword>div{
            display:inline-block;
            width:21%;
            box-sizing: border-box;
            text-align: center;
            color: #626262;
            cursor:pointer;
        }
        .tishiword>div.active{
            color: #b92b27;
        }
        .listplace .Cell{cursor:pointer;}
        .action_bar_inner>.actionlist>div.commentNews{
            color: #6E839C;
            background: url(img/secondword2.png)no-repeat left;
            background-size: 14px;
            padding-left: 17px;
            cursor: pointer;
        }
        .action_bar_inner>.actionlist>div.thumbNews{
            background: url(img/noheart2.png)no-repeat left;
            background-size: 14px;
            padding-left: 17px;
            margin-right: 17px;
            cursor:pointer;
        }
        .action_bar_inner>.actionlist>div.thumbNews.clicked{
            background: url(img/redheart.png)no-repeat left;
            background-size: 14px;
        }
    </style>
    <style>
        .username{color: #576b95;}
        .zan-person>div{font-size:14px;}
        .secondword .userword.commentbtn {word-break: break-all;}
        .common-iconfont.zan-person.js_zan{
            margin-top:5px;
            font: 400 14px/1.5 Arial,"Lucida Grande",Verdana,"Microsoft YaHei",hei;
        }
        .secondword>div>span:last-child{cursor:pointer;}
        .delnews.rt{
            width: 20px;
            text-align: center;
            font-size: 28px;
            color: #6E839C;
            position: absolute;
            right: 0;
            top: -10px;
            z-index: 100;
        }
    </style>
</head>
<body>
<div id="choiceThree" style="display:block;">
    <div id="alwayspage" style="display:block;">
        <div class="PageWrapper nonav">
            <!-- 头部-->
            <div class="Header ModalHeader">
                <div class="fixed_header">
                    <div class="header_main">
                        <div class="mweb_modal_back_button" id="alwaysgoback"></div>
                        <div class="header_action_buttons mweb_lookup_bar_has_input">
                            <a class="mweb_lookup_bar_input_wrapper mweb_lookup_bar_input_wrapper_fake" style="width:100%;height:auto;" href="searchdetail.html">
                                <div class="mweb_lookup_bar_input" style="height: 31px;line-height:21px;text-align:left;font-size: 14px;color:#BC7F74;background-color:#91201c;border:none;">请输入关键词搜索</div>
                            </a>
                        </div>
                        <a class="navigation_button" id="alwaysgobackbtn"></a>
                        <a class="logo symbol_logo" id="sendbtn"><span><b style="top:-12px;"></b>分享网址</span></a>
                    </div>
                </div>
            </div>
        </div>
        <!-- 搜索框-->
        <div class="inputsearchbox">
            <div>
                <div class="header_action_buttons mweb_lookup_bar_has_input">
                    <div class="mweb_lookup_bar_input_wrapper ">
                        <div class="mweb_lookup_bar_input" style="min-height: 29px;font-size: 14px; color:#BC7F74;">
                            <div id="alsearchbtn"></div>
                            <input type="text" id="alsearchinput" placeholder="搜索" style="width:100%;color:#999" maxlength="16"/>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <!-- 类别切换-->
        <nav>
            <a href="javascript: ;" id="allnewsbox" class=" active">资讯圈
            </a><a href="javascript: ;" id="lastbox">最新资讯
            </a><a href="javascript: ;" id="alllistbox">全部订阅
            </a>
            <!--<a href="javascript: ;">综合资讯-->
            <!--</a><a href="javascript: ;" class="">行业新闻-->
            <!--</a><a href="javascript: ;" class="">兴趣爱好</a>-->
        </nav>
        <!-- 提示9个-->
        <div id="maxNine">
            <span class="max">最多选择9个订阅号!</span>
            <span class="min">订阅号至少选择一个!</span>
        </div>
        <div class="tishiword">

            <div id="alllistbox2" class="active">订阅资讯
            </div><div id="zhlistbox">综合资讯
            </div><div id="hylistbox">行业新闻
            </div><div id="xqlistbox">兴趣爱好</div>
        </div>
        <!-- 全部新闻-->
        <div class="listplace allnewsbox">
            <div class="body"></div>
            <!-- 请等待-->
            <div id="pleasewait">
                <div class="waitbox">
                    <div id="waiting">加载中...</div>
                    <div id="nonews" style="display:none">没有更多信息</div>
                </div>
            </div>
        </div>
        <!-- 最新资讯-->
        <div class="listplace lastbox">
            <div class="body"></div>
            <!-- 请等待-->
            <div id="pleasewait2">
                <div class="waitbox">
                    <div id="waiting2">加载中...</div>
                    <div id="nonews2" style="display:none">没有更多信息</div>
                </div>
            </div>
        </div>
        <!-- 全部订阅-->
        <div class="listplace alllistbox">
            <div class="body"></div>
            <!-- 请等待-->
            <div id="pleasewait1">
                <div class="waitbox">
                    <div id="waiting1">加载中...</div>
                    <div id="nonews1" style="display:none">没有更多信息</div>
                </div>
            </div>
        </div>
        <!-- 综合加载区-->
        <div class="listplace zhlistbox"></div>
        <!-- 行业加载区-->
        <div class="listplace hylistbox"></div>
        <!-- 兴趣加载区-->
        <div class="listplace xqlistbox"></div>

        <div class="searchlistplace"></div>
    </div>
</div>
<!-- 删除转发新闻-->
<div class="action_menu_container ModelForm" id="delmynews" style="display:none;">
    <div class="inner">
        <div class="ModelFormBody" id="delmynewsform">
            <div class="action_menu">
                <a class="mweb_action_button">提醒</a>
            </div>
            <div class="action_menu">
                <a class="mweb_action_button">是否删除此新闻？</a>
            </div>
            <div class="action_menu">
                <div class="rt" id="delmynewsok">确定</div>
                <div id="delmynewscancel">取消</div>
            </div>
        </div>
    </div>
</div>

<div class="action_menu_container ModelForm" id="threeFriend" style="display: none;">
    <div class="inner">
        <div class="ModelFormBody">
            <div class="action_menu">
                <a class="mweb_action_button">你已经点击<span id="threeFriendNick">TA</span>的pulu3次，是否发送好友请求？</a>
            </div>
            <div class="action_menu">
                <div class="rt" id="threeFriOk">确定</div>
                <div id="threeFriNo">取消</div>
            </div>
        </div>
    </div>
</div>

<div class="action_menu_container" id="collectword" style="display: none;">
    <div class="inner">
        <div class="action_menu" style="padding-top: 144px;">
            <a class="mweb_action_button" style="border-radius: 2px;">您已经点过赞</a>
        </div>
    </div>
</div>
<script src="js/jquery-1.11.3.min.js"></script>
<script src="js/jquery.cookie.js"></script>
<script type="text/javascript" src="sdk/webim.config.js"></script>
<script src="sdk/strophe.js"></script>
<script src="sdk/websdk-1.1.2.js"></script>
<script src="ftnjs/urlnote.js"></script>
<script src="ftnjs/ctoe.js"></script>
<script src="ftnjs/codetofacejs.js"></script>
<script src="ftnjs/commentFtn.js"></script>
<script>
    /*
     环信
     */
    /*保存好友申请*/
    //环信建立连接
    var conn = new WebIM.connection({
        https: WebIM.config.https,
        url: WebIM.config.xmppURL,
        isAutoLogin: WebIM.config.isAutoLogin,
        isMultiLoginSessions: WebIM.config.isMultiLoginSessions
    });
    //登录
    var options = {
        apiUrl: WebIM.config.apiURL,
        user:$.cookie("MYID"),
        pwd:$.cookie("MYID"),
        appKey: "pulu#pulu"
    };
    conn.open(options);
    var havingnewsnow="no";//当前没有好友信息
    var fromuserid;
    //函数列队执行--------------------------------------
    var stack=[];//保存执行函数数组
    var messarrid=[];//保存信息 ↑stack中函数使用
    //编写函数列队方法 next();
    function next(){
        //执行最靠前的一个
        var fn=stack[0];
        if(typeof fn==="function")fn(messarrid[0]);
    }
    conn.listen({
        //事件监听（加好友通知）
        onPresence: function ( e ) {
            //只处理好友申请
            if ( e.type === 'subscribe'&&(e.status!="[resp:true]")){
                //处理信息数据格式 方便调用
                var mes={"type":e.type,"from":e.from,"status":e.status};
                //将信息插入到数组中 进行保存
                messarrid.push(mes);
                //服务器传递数据
                function sendfriendnot(e){
                    if ( e.type === 'subscribe' ){
                        $.ajax({
                            type:"post",
                            url:savefriendnoteurl,
                            data:{"userId":id,"friendId":e.from,"msg":e.status},
                            success:function(d){
                                stack.shift();
                                messarrid.shift();
                                next();
                            }
                        });
                    }
                }
                //将方法插入到数组中 列队执行
                //stack.push(handlePresence);
                stack.push(sendfriendnot);
                //执行next()
                next();
            }

        },
        //收到联系人订阅请求、处理群组、聊天室被踢解散等消息
        onOpened: function ( message ) {          //连接成功回调
            //如果isAutoLogin设置为false，那么必须手动设置上线，否则无法收消息
            conn.setPresence();
            conn.getRoster({
                success: function ( roster ) {
                    for ( var i = 0, l = roster.length; i < l; i++ ) {
                        var ros = roster[i];
                        //ros.subscription值为both/to为要显示的联系人，此处与APP需保持一致，才能保证两个客户端登录后的好友列表一致
                        if ( ros.subscription === 'both' || ros.subscription === 'to' ) {

                        }
                    }
                },
                error:function(d){
                    console.log(d);
                }
            });
        }
    });
</script>
<script src="js/subscribe.js"></script>
</body>
</html>